<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>选课系统-学生-选课结果列表</title>

		<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
		<!-- Custom styles for this template -->
		<link th:href="@{/css/dashboard.css}" rel="stylesheet">

		<script th:src="@{/js/bootstrap.min.js}"></script>
		<script type="text/javascript" th:src="@{/js/jquery-3.2.1.js}"></script>
		<script type="text/javascript">
			function deleteSelect(courseId){
				$.ajax({
					type: "POST",
					url:"/stu/deleteSelect",
					data:{'courseId':courseId},
					success:function (data) {
						alert(data);
					},
					error : function(e){
						console.log(e.status);
						console.log(e.responseText);
					}
				});
			}

		</script>


	</head>

	<body>
	<div th:replace="~{commons::topbar}"></div>

		<div class="container-fluid">
			<div class="row">
				<div th:replace="~{commons::sidebar(active='myselect')}"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">




					<br>
					<div class="table-responsive">
						<table class="table table-striped table-sm">
							<thead>
								<tr>
									<th>课程id</th>
									<th>课程名称</th>
									<th>开课学院</th>
									<th>开课老师</th>
									<th>学分</th>
									<th>课程详情</th>
									<th>开课时间</th>
									<th th:if="${selectState eq 1}">操作</th>

								</tr>
							</thead>
							<tbody id="CourseList">
								<tr th:each="cou:${courses}">
									<td th:text="${cou.getCourseId()}"></td>
									<td th:text="${cou.getCourseName()}"></td>
									<td th:text="${cou.getCollegeName()}"></td>
									<td th:text="${cou.getTeacherName()}"></td>
									<td th:text="${cou.getCourseScore()}"></td>
									<td th:text="${cou.getDescription()}"></td>
									<td th:text="${cou.getSchedule()}"></td>
									<td th:if="${selectState eq 1}">
										<a class="btn btn-sm btn-danger" th:href="|javascript:deleteSelect(${cou.getCourseId()})|">删除</a>
									</td>

								</tr>
							</tbody>
						</table>
					</div>
				</main>
			</div>
		</div>

	</body>

</html>